package com.webmall.servlet.user;

import com.webmall.entity.UserEntity;
import com.webmall.service.webmall_UserDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/manageHtml/admin_toUserUpdate")
public class toUserUpdate extends HttpServlet {


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //获取请求 先设计字符集
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=utf-8");

        //获取参数
        String id = request.getParameter("id");
        //select by id
        UserEntity user = webmall_UserDao.selectById(id);

        request.setAttribute("user",user);
        request.setAttribute("cpage",request.getParameter("cpage"));
        request.getRequestDispatcher("/manageHtml/admin_usermodify.jsp").forward(request,response);
    }
}
